import React, { Component, createRef} from 'react'
import ChildComponent from './ChildComponent'
export class App extends Component {

  myref = createRef()

  // componentDidMount() {
  //   this.myref.current.focus()
  // }
  render() {
    return (
      <div>
        <button onClick={()=>{this.myref.current.focus()}}>focus</button>
        <ChildComponent ref={this.myref}/>
      </div>
    )
  }
}
